/*

Author   : chaos

FileName : ptr_to_const.cpp

Date     : 11/08/17 23:41:29

*/
#include <iostream>
#include <cstring>
using namespace std;

class Reader
{
    private:
        char name[10];
    public:
        Reader(char * i_name)
        {strcpy(name,i_name);}

        const char * get_const_name(){return name;}
        char * get_name(){return name;}

        void show_name() const{
            cout << "name :" << name << endl;
        }
};

int main(int argc ,char *argv[])
{
    Reader A_Reader("John");
    const char * const_reader_name;
    char * reader_name;

    const_reader_name = A_Reader.get_const_name();

        //*(const_reader_name +2) = 'c';

    A_Reader.show_name();

    reader_name = A_Reader.get_name();

    *(reader_name + 2) = 'c';

    A_Reader.show_name();

    return 0;
}
